package com.ruoyi.factory.taxShare.controller;

import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.factory.qylock.utils.OkHttpUtils;
import com.ruoyi.factory.taxShare.domain.BdMaterial;
import com.ruoyi.factory.taxShare.service.Itestservice;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import okhttp3.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Controller;
import nccloud.open.api.auto.token.cur.utils.APICurUtils;
import nccloud.open.api.auto.token.itf.IAPIUtils;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;


/**
 * @ClassName TokenTest
 * @Description: TODO
 * @Author LiuJiaji
 * @Date 2023/7/31 16:27
 **/
@Controller("tokenTest")
@EnableScheduling
public class TokenTest {

    @Autowired
    private Itestservice itestservice;

    /**
     * 测试查询所有
     */
    public void testFindAll() {
        itestservice.test();
    }
//
//    public static void main(String[] args) {
//        JSONObject value1 = new JSONObject();
//        value1.put("value1","value1");
//        JSONObject cfirstbid1 = new JSONObject();
//        cfirstbid1.put("cfirstbid1",value1);
//        JSONObject cfirstbid2 = new JSONObject();
//        cfirstbid1.put("cfirstbid2",value1);
//        JSONObject cfirstbizi = new JSONObject();
//        cfirstbid1.put("cfirstbizi","cfirstbizi");
//
//        JSONObject bvalues = new JSONObject();
//
//        bvalues.put("values",cfirstbid1);
//        JSONObject bvalues2 = new JSONObject();
////        JSONArray bvalues2 = new JSONArray();
////        bvalues2.add(bvalues);
//        bvalues2.put("status","status");
//        bvalues2.put("values",cfirstbid1);
//
////        bvalues.put("values",cfirstbid2);
//
//        JSONObject rowsobj = new JSONObject();
//        JSONObject card_body = new JSONObject();
//        JSONArray rows = new JSONArray();
//
//        rowsobj.put("status","ces");
//        rowsobj.put("bvalues",bvalues);
//        rowsobj.put("bvalues",bvalues);
//        rows.add(rowsobj);
//        rows.add(rowsobj);
//        card_body.put("rows",rows);
//        card_body.put("areaType","table");
//        String s = bvalues2.toString();
//        System.out.println(s);
//
//
//
//
//
//    }

//    public static void main(String[] args) throws Exception {
//        IAPIUtils util = null;
//        //		util = new APIOldUtils(); // 2021.05之前版本
//        util = new APICurUtils();// 2021.05版本及以后版本
//        // 服务地址ip
//        String ip = "192.168.0.16";
////        String ip = "192.168.0.152";
//        // 服务端口号
//        String port = "8087";
////        String port = "3010";
//        // 账套编码，开发环境使用develop，生产环境需要使用用root账号登录，在“系统管理”节点查看账套编码
//        String busi_center = "01";
//        // 第三方应用编码
//        String app_id = "cs";
//        // app_secret，用于请求加签
//        String app_secret = "53a8f3c693d04b5aa380";
//        // 公钥，加解密使用
//        String public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArofzCUok/Ub71lN8o2OQzZ1r6bfK+aoM6ua71fM2qAP8UUeuFnA9ZJYME3kBo1WU5OW8lcFTSGLyX8SdbfOsuRfKZr78pWLxY4gN/SutZSGirmjXQTjRE55mYOQKfdE0k20ERygjKHFrV4BsXPSHB4SPDbtFq5ecVeCu8LmjKcJ20UZZxkkO8NFzqlXqJsVO/+z5/Vsdu4DYW+eU8sIu2P+caHFKmZ5CO/dL4tgBTo3LuiXaTa0er9di2MZND2IYu1LOsIWoDcK70BHeJsHcP2xlamaDCsFyPHFiBE46goYGTr6OmdT4nAUdSay/gM7YhmKwZogynqvJd1K8UnS7cQIDAQAB";
//        // ncc用户名
//        String ncc_user = "001194";
//        // ncc用户密码
//        String password = "admin123!";
////        String secret_level = "L0";
//        String grant_type = "client";
//        util.init(ip, port, busi_center, app_id, app_secret, public_key, ncc_user, password);
//        util.setGrant_type(grant_type);
//        // 获取token
//        String token = util.getToken();
//        System.out.println("获取token"+token);
//        // 请求的OpenAPI接口地址，注意nccloud前面没有"/ nccloud/api/nccloud/api/uapbd/psndocmanage/psndoc/add"
////        String apiuri = "nccloud/api/pu/invoice/save";
//        String apiuri = "nccloud/api/uapbd/customermanage/baseinfo/getCustomerbaseinfo";
////        String apiuri = "nccloud/api/ic/purchasein/commonquery";
////        String apiuri = "nccloud/api/ic/purchasein/schemequery";
//        System.out.println("获取apiurl "+apiuri);
//        util.setApiUrl(apiuri);
//        // 接口请求参数
//        String requestParam = "";
//        System.out.println("参数"+requestParam);
//        String[] ss = {"123"};
//        // 携带token访问接口，获取结果
//        String result = util.getAPIRetrun(token, requestParam);
//        System.out.println("-----------------");
//        System.out.println("返回结果 :"+result);
//        System.out.println("sss");
//    }


    public static void main(String[] args) throws Exception {
        IAPIUtils util = null;
        //		util = new APIOldUtils(); // 2021.05之前版本
        util = new APICurUtils();// 2021.05版本及以后版本
        // 服务地址ip
//        String ip = "192.168.0.152";
        String ip = "192.168.0.16";
//        String ip = "192.168.0.249";
        // 服务端口号
//        String port = "3010";
        String port = "8087";
//        String port = "8188";
        // 账套编码，开发环境使用develop，生产环境需要使用用root账号登录，在“系统管理”节点查看账套编码
        String busi_center = "01";
        // 第三方应用编码
        String app_id = "cs";
        // app_secret，用于请求加签
        String app_secret = "53a8f3c693d04b5aa380";
        // 公钥，加解密使用
        String public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArofzCUok/Ub71lN8o2OQzZ1r6bfK+aoM6ua71fM2qAP8UUeuFnA9ZJYME3kBo1WU5OW8lcFTSGLyX8SdbfOsuRfKZr78pWLxY4gN/SutZSGirmjXQTjRE55mYOQKfdE0k20ERygjKHFrV4BsXPSHB4SPDbtFq5ecVeCu8LmjKcJ20UZZxkkO8NFzqlXqJsVO/+z5/Vsdu4DYW+eU8sIu2P+caHFKmZ5CO/dL4tgBTo3LuiXaTa0er9di2MZND2IYu1LOsIWoDcK70BHeJsHcP2xlamaDCsFyPHFiBE46goYGTr6OmdT4nAUdSay/gM7YhmKwZogynqvJd1K8UnS7cQIDAQAB";
        // ncc用户名
        String ncc_user = "001194";
        // ncc用户密码
        String password = "admin123!";
//        String secret_level = "L0";
        String grant_type = "client";
        util.init(ip, port, busi_center, app_id, app_secret, public_key, ncc_user, password);
        util.setGrant_type(grant_type);
        // 获取token
        String token = util.getToken();
        System.out.println("获取token"+token);
        // 请求的OpenAPI接口地址，注意nccloud前面没有"/ nccloud/api/nccloud/api/uapbd/psndocmanage/psndoc/add"
//        String apiuri = "nccloud/api/pu/invoice/save";
        String apiuri = "nccloud/api/pu/invoice/operation/save";
//        String apiuri = "nccloud/api/uapbd/customermanage/baseinfo/getCustomerbaseinfo";
//        String apiuri = "nccloud/api/pu/invoicemanage/baseinfo/setInvoicebaseinfo";
//        String apiuri = "nccloud/api/platform/attachmentuploadurl/baseinfo/uploadfileurl";
//        String apiuri = "nccloud/api/pu/invoice/save";
        util.setApiUrl(apiuri);
        // 接口请求参数
//        String requestParam = "{\n" +
//                "    \"dbilldate\":\"2022-04-25 17:38:00~2023-012-27 17:39:00\",\n" +
//                "    \"pk_org\":\"1001\",\n" +
//                "    \"vbillcode\":[\n" +
//                "        \"rf282312180001\"\n" +
//                "    ]\n" +
//                "}";
//        String requestParam = "{\"pageid\":\"400401600_card\",\"head\":{\"card_head\":{\"areaType\":\"form\",\"rows\":[{\"values\":{\"pk_org_v\":{\"value\":\"0001A110000000002TJ9\"},\"ctrantypeid\":{\"value\":\"0001A110000000002BLW\"},\"finvoiceclass\":{\"value\":\"0\"},\"dbilldate\":{\"value\":\"2024-02-22 15:36:17\"},\"darrivedate\":{\"value\":\"2024-02-22 15:36:17\"},\"pk_supplier\":{\"value\":\"1001A11000000005T1WE\"},\"pk_supplier_v\":{\"value\":\"1001A11000000005T1WE\"},\"corigcurrencyid\":{\"value\":\"1002Z0100000000001K1\"},\"pk_bizpsn\":{\"value\":\"0001A11000000000K7G0\"},\"pk_dept_v\":{\"value\":\"0001A91000000006WZBD\"},\"pk_stockorg_v\":{\"value\":\"0001A110000000002TJ9\"},\"pk_paytosupplier\":{\"value\":\"1001A11000000005T1WE\"},\"pk_balatype\":{\"value\":\"\"},\"binitial\":{\"value\":false},\"ntotalastnum\":{},\"ntotalorigmny\":{},\"vmemo\":{\"value\":\"RFXC-CG-A-202401-015\"},\"pk_org\":{\"value\":\"0001A110000000002TJA\"},\"vbillcode\":{\"value\":\"rf202402221537l\"},\"bvirtual\":{},\"bfee\":{},\"pk_freecust\":{},\"supplierphone\":{},\"pk_dept\":{\"value\":\"1001A110000000002RCB\"},\"pk_stockorg\":{\"value\":\"0001A110000000002TJA\"},\"ts\":{},\"dmakedate\":{},\"creator\":{\"value\":\"1001A11000000009I64N\"},\"approver\":{\"value\":\"1001A11000000009I64N\"},\"vtrantypecode\":{\"value\":\"25-01\"},\"taudittime\":{},\"creationtime\":{\"value\":\"2024-02-22 15:36:17\"},\"pk_frozenuser\":{},\"modifier\":{},\"tfrozentime\":{},\"modifiedtime\":{},\"pk_bankaccbas\":{\"value\":\"1001A11000000005T1XB\"},\"vbankaccount\":{},\"ccurrencyid\":{\"value\":\"1002Z0100000000001K1\"},\"nexchangerate\":{\"value\":\"1.00\"},\"vfrozenreason\":{},\"bfrozen\":{},\"pk_busitype\":{\"value\":\"1001A110000000002LBB\"},\"pk_purchaseorg\":{\"value\":\"0001A110000000002TJA\"},\"pk_purchaseorg_v\":{\"value\":\"0001A110000000002TJ9\"},\"pk_payterm\":{},\"ftaxtypeflagh\":{\"value\":\"1\"},\"ntaxrateh\":{\"value\":\"13.00\"},\"vparentcode\":{},\"pk_parentinvoice\":{},\"ngroupexchgrate\":{\"value\":\"1.00\"},\"nglobalexchgrate\":{\"value\":\"1.00\"},\"vdef1\":{\"value\":\"\"},\"vdef2\":{},\"vdef3\":{},\"vdef4\":{},\"vdef5\":{},\"vdef6\":{},\"vdef7\":{},\"vdef8\":{},\"vdef9\":{},\"vdef10\":{\"value\":\"\"},\"vdef11\":{},\"vdef12\":{},\"vdef13\":{},\"vdef14\":{},\"vdef15\":{},\"vdef16\":{},\"vdef17\":{},\"vdef18\":{},\"vdef19\":{},\"vdef20\":{},\"bapflag\":{},\"pk_invoice\":{},\"fbillstatus\":{\"value\":\"0\"},\"pk_group\":{\"value\":\"0001A110000000000C8B\"},\"iprintcount\":{\"value\":\"0\"},\"csendcountryid\":{\"value\":\"0001Z010000000079UJJ\"},\"crececountryid\":{\"value\":\"0001Z010000000079UJJ\"},\"ctaxcountryid\":{\"value\":\"0001Z010000000079UJJ\"},\"fbuysellflag\":{\"value\":\"2\"},\"btriatradeflag\":{\"value\":false},\"ctradewordid\":{\"value\":\"\"},\"bopptaxflag\":{\"value\":false},\"vvatcode\":{},\"vvendorvatcode\":{},\"finvoicetype\":{\"value\":\"0\"},\"saga_frozen\":{},\"saga_gtxid\":{},\"saga_btxid\":{},\"saga_status\":{},\"cextsrcsys\":{},\"billmaker\":{\"value\":\"1001A11000000009I64N\"},\"fratecategory\":{},\"vextsrcbillcode\":{},\"dratedate\":{},\"pseudocolumn\":{},\"vdef21\":{},\"vdef22\":{},\"vdef27\":{},\"vdef28\":{},\"vdef29\":{},\"vdef23\":{},\"vdef24\":{},\"vdef25\":{},\"vdef26\":{},\"vdef30\":{},\"vdef31\":{},\"vdef32\":{},\"vdef33\":{},\"vadjustreason\":{},\"vdef38\":{},\"vdef39\":{},\"vdef34\":{},\"vdef35\":{},\"vdef36\":{},\"vdef37\":{},\"vdef41\":{},\"vdef42\":{},\"vdef43\":{},\"vdef44\":{},\"vdef40\":{},\"dr\":{},\"vdef49\":{},\"vdef45\":{},\"vdef46\":{},\"vdef47\":{},\"vdef48\":{},\"vdef50\":{},\"csaleinvoiceid\":{},\"pk_paytosupplier_v\":{\"value\":\"1001A11000000005T1WE\"},\"cratetype\":{}},\"status\":\"1\"}],\"areacode\":\"card_head\"}},\"body\":{\"card_body\":{\"areaType\":\"table\",\"rows\":[{\"status\":\"2\",\"isOptimized\":false,\"values\":{\"cfirstbid\":{\"value\":\"1001ZZ100000001TVANE\"},\"naccumsettorigmny\":{},\"nnosubtax\":{\"value\":\"0.00\"},\"nastprice\":{\"value\":\"13.911504\"},\"pk_material.name\":{\"value\":\"H-3(液体）\"},\"cextsrcbid\":{},\"vextsrcbillcode\":{},\"vordercode\":{\"value\":\"CD2401090003\"},\"norigtaxprice\":{\"value\":\"15.720000\"},\"vbdef45\":{},\"ngroupmny\":{\"value\":\"13.91\"},\"vbdef46\":{},\"pk_material\":{\"value\":\"1001A11000000009ATY5\"},\"vbdef43\":{},\"casscustid\":{},\"nnumwrbck\":{},\"vbdef44\":{},\"csourcetypecode\":{\"value\":\"45\"},\"vbdef49\":{},\"vbdef47\":{},\"vbdef48\":{},\"vbdef41\":{},\"vbdef42\":{},\"vbdef40\":{},\"naccumsettmny\":{},\"ftaxtypeflag\":{\"value\":\"1\"},\"vfree10\":{},\"pk_order\":{\"value\":\"1001ZZ100000001TVAND\"},\"pseudocolumn\":{\"value\":\"0\"},\"vfirstcode\":{\"value\":\"CD2401090003\"},\"castunitid\":{\"value\":\"1001A1100000000005GQ\"},\"pk_apfinanceorg_v\":{\"value\":\"0001A110000000002TJ9\"},\"cunitid\":{\"value\":\"1001A1100000000005GQ\"},\"cfirsttypecode\":{\"value\":\"21\"},\"ntaxmny\":{\"value\":\"15.72\"},\"pk_order_b\":{\"value\":\"1001ZZ100000001TVANE\"},\"vordertrantype\":{\"value\":\"1001A110000000002KOR\"},\"vmemob\":{},\"ntaxprice\":{\"value\":\"15.720000\"},\"vbdef50\":{},\"cextsrcbilltype\":{},\"vsourcerowno\":{\"value\":\"10\"},\"firstts\":{},\"nastnum\":{\"value\":\"1.00000\"},\"ntax\":{\"value\":\"1.81\"},\"vsourcecode\":{\"value\":\"rf282401090003\"},\"dbilldate\":{},\"cextsrcid\":{},\"csourceid\":{\"value\":\"1001ZZ100000001TVAOR\"},\"nnosubtaxrate\":{\"value\":\"0.00\"},\"cffileid\":{},\"ccontractrowid\":{},\"nglobalmny\":{\"value\":\"13.91\"},\"nnum\":{\"value\":\"1.00000\"},\"pk_invoice_b\":{},\"pk_material.materialspec\":{\"value\":\"罐装\"},\"vbdef9\":{},\"cfirstid\":{\"value\":\"1001ZZ100000001TVAND\"},\"vctcode\":{},\"nglobaltaxmny\":{\"value\":\"15.72\"},\"ts\":{},\"pk_group\":{\"value\":\"0001A110000000000C8B\"},\"casscustvid\":{},\"frowtype\":{\"value\":\"0\"},\"pk_apliabcenter\":{},\"cadjustedrowid\":{},\"firstbts\":{},\"pk_usedept\":{},\"pk_stordoc\":{\"value\":\"1001A9100000001L10CE\"},\"dr\":{},\"nsourcenum\":{\"value\":\"31110.00000\"},\"nprice\":{\"value\":\"13.911504\"},\"pk_org\":{\"value\":\"0001A110000000002TJA\"},\"vbdef8\":{},\"pk_supplier\":{},\"vbdef7\":{},\"vbdef6\":{},\"naccumsettnum\":{},\"vbdef5\":{},\"vbdef4\":{},\"vbdef3\":{},\"vbdef2\":{},\"vbdef1\":{},\"cprojecttaskid\":{},\"nreasonwastenum\":{},\"ngrouptaxmny\":{\"value\":\"15.72\"},\"vfree1\":{},\"sourcebts\":{\"value\":\"2024-02-22 14:45:51\"},\"vfirsttrantype\":{\"value\":\"1001A110000000002KOR\"},\"pk_apfinanceorg\":{\"value\":\"0001A110000000002TJA\"},\"pk_order_payplan\":{},\"vsourcetrantype\":{\"value\":\"1001A110000000002L2G\"},\"dsourcedate\":{\"value\":\"2024-01-09 09:43:21\"},\"vbdef12\":{},\"pk_supplier_v\":{},\"vbdef13\":{},\"vbdef10\":{},\"vbdef11\":{},\"nasttaxprice\":{\"value\":\"15.720000\"},\"pk_srcmaterial\":{\"value\":\"1001A11000000009ATY5\"},\"vbdef16\":{},\"vbdef17\":{},\"vbdef14\":{},\"ntaxrate\":{\"value\":\"13.00\"},\"vbdef15\":{},\"vfree8\":{},\"vfree9\":{},\"vfree6\":{},\"pk_org_v\":{\"value\":\"0001A110000000002TJ9\"},\"vfree7\":{},\"cproductorid\":{},\"vfree4\":{},\"nadjustorgprice\":{},\"vfree5\":{},\"vfree2\":{},\"vfirstrowno\":{\"value\":\"5\"},\"vfree3\":{},\"pk_order_payplan_b_ts\":{},\"pk_usedept_v\":{},\"cqualitylevelid\":{},\"norigtaxmny\":{\"value\":\"15.72\"},\"pk_invoice\":{},\"pk_stockps_b\":{},\"vbdef18\":{},\"vbdef19\":{},\"sourcets\":{\"value\":\"2024-01-09 09:44:02\"},\"vbdef23\":{},\"ctaxcodeid\":{\"value\":\"1002Z01000000001CNE2\"},\"vbdef24\":{},\"nastorigtaxprice\":{\"value\":\"15.720000\"},\"vbdef21\":{},\"vbdef22\":{},\"csourcebid\":{\"value\":\"1001ZZ100000001TVAOS\"},\"vbdef27\":{},\"pk_apliabcenter_v\":{},\"vbdef28\":{},\"cadjustedinvid\":{},\"vbdef25\":{},\"vbdef26\":{},\"pk_costsubj\":{},\"pk_batchcode\":{\"value\":\"1001ZZ100000001TVAOQ\"},\"nplanprice\":{},\"vbdef20\":{},\"naccumnosubmny\":{},\"pk_order_payplan_ts\":{},\"cprojectid\":{},\"vchangerate\":{\"value\":\"1/1\"},\"pk_material.materialtype\":{},\"vbdef29\":{},\"norigprice\":{\"value\":\"13.911504\"},\"vbdef34\":{},\"vbdef35\":{},\"crowno\":{\"value\":\"10\"},\"vbdef32\":{},\"vbdef33\":{},\"ncaltaxmny\":{\"value\":\"13.91\"},\"pk_order_payplan_b\":{},\"vbdef38\":{},\"vbdef39\":{},\"ccontractid\":{},\"vbdef36\":{},\"nastorigprice\":{\"value\":\"13.911504\"},\"vbdef37\":{},\"vbatchcode\":{\"value\":\"20240102\"},\"nmny\":{\"value\":\"13.91\"},\"norigmny\":{\"value\":\"13.91\"},\"vbdef30\":{},\"ncalcostmny\":{\"value\":\"13.91\"},\"vadjedbillcode\":{},\"vbdef31\":{},\"opr\":{},\"numberindex\":{\"value\":\"1\"}},\"key\":\"778450.36b3903bb2a513a\",\"rowId\":\"778450.36b3903bb2a513a\",\"rowid\":\"778450.36b3903bb2a513a\",\"pid\":\"root\",\"isLeaf\":true,\"depth\":0,\"path\":[\"778450.36b3903bb2a513a\"],\"height\":0,\"dataIndex\":0,\"leafIndex\":0,\"range\":[0,1],\"viewIndex\":0,\"selected\":false}],\"areacode\":\"card_body\"}},\"templetid\":\"1001A110000000002VWX\",\"skipCodes\":[]}";
        String pp = "{\"success\":true,\"data\":[{\"ic.PurchaseInHeadVO\":{\"cwhsmanagerid\":{\"code\":\"001182\",\"name\":\"杨丽君\",\"pk\":\"0001A11000000001JALE\"},\"fbillflag\":3,\"corpoid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJA\"},\"ctaxcountryid\":{\"code\":\"CN\",\"name\":\"中国\",\"pk\":\"0001Z010000000079UJJ\"},\"cpurorgoid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJA\"},\"ctrantypeid\":\"1001A110000000002L3S\",\"dmakedate\":\"2023-12-18 16:08:33\",\"ntotalpiece\":\"0\",\"cfanaceorgvid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJ9\"},\"crececountryid\":{\"code\":\"CN\",\"name\":\"中国\",\"pk\":\"0001Z010000000079UJJ\"},\"cvendorid\":{\"code\":\"01000916\",\"name\":\"郑州特种电缆有限公司\",\"pk\":\"1001A110000000000YX0\"},\"dbilldate\":\"2023-12-18 16:08:29\",\"ccostdomainid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司成本域\",\"pk\":\"1001A1100000000031XI\"},\"cbiztype\":\"1001A110000000002LDC\",\"cpayfinorgoid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJA\"},\"cpurorgvid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJ9\"},\"approver\":{\"code\":\"001182\",\"name\":\"杨丽君\",\"pk\":\"1001A11000000009I64N\"},\"creator\":{\"code\":\"001182\",\"name\":\"杨丽君\",\"pk\":\"1001A11000000009I64N\"},\"cwarehouseid\":{\"code\":\"rf02\",\"name\":\"配件库\",\"pk\":\"1001A1100000000012LG\"},\"vtrantypecode\":\"45-Cxx-05\",\"cvendorvid\":{\"code\":\"01000916\",\"name\":\"郑州特种电缆有限公司\",\"pk\":\"1001A110000000000YX0\"},\"cbizid\":{\"code\":\"000118\",\"name\":\"史东方\",\"pk\":\"0001A110000000003860\"},\"csendcountryid\":{\"code\":\"CN\",\"name\":\"中国\",\"pk\":\"0001Z010000000079UJJ\"},\"vbillcode\":\"RFPJ2312180002\",\"ts\":\"2023-12-18 16:08:36\",\"pk_group\":{\"code\":\"1\",\"name\":\"瑞丰集团\",\"pk\":\"0001A110000000000C8B\"},\"cpayfinorgvid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJ9\"},\"ntotalnum\":\"4999\",\"pk_org\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJA\"},\"cgeneralhid\":\"1001A0100000001TGMDU\",\"ntotalweight\":\"0\",\"cdptid\":{\"code\":\"100111\",\"name\":\"工程装备部\",\"pk\":\"1001A110000000002RCI\"},\"bitinbill\":\"N\",\"btriatradeflag\":\"N\",\"billmaker\":{\"code\":\"001182\",\"name\":\"杨丽君\",\"pk\":\"1001A11000000009I64N\"},\"fbuysellflag\":2,\"cfanaceorgoid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJA\"},\"creationtime\":\"2023-12-18 16:08:33\",\"pk_org_v\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJ9\"},\"freplenishflag\":\"N\",\"cdptvid\":{\"code\":\"100111\",\"name\":\"工程装备部\",\"pk\":\"0001A91000000006WZEB\"},\"corpvid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJ9\"},\"ntotalvolume\":\"0\",\"iprintcount\":0,\"taudittime\":\"2023-12-18 16:08:36\"},\"ic.PurchaseInBodyVO\":[{\"nnosubtax\":\"0\",\"cbodytranstypecode\":\"45-Cxx-05\",\"ccurrencyid\":{\"code\":\"CNY\",\"name\":\"人民币\",\"pk\":\"1002Z0100000000001K1\"},\"ftaxtypeflag\":1,\"csourcetranstype\":\"1001A110000000002KPV\",\"nqtorigtaxnetprice\":\"4.65\",\"csourcetype\":\"21\",\"nshouldassistnum\":\"4999\",\"nqtnetprice\":\"4.115044\",\"vsourcerowno\":\"10\",\"ntax\":\"2674.24\",\"norigtaxnetprice\":\"4.65\",\"nnosubtaxrate\":\"0\",\"bbarcodeclose\":\"N\",\"nnum\":\"4999\",\"nqtprice\":\"4.115044\",\"dbizdate\":\"2023-12-18 16:08:29\",\"nglobaltaxmny\":\"23245.35\",\"ts\":\"2024-01-05 16:38:39\",\"cfirsttype\":\"21\",\"ntaxnetprice\":\"4.65\",\"nqttaxprice\":\"4.65\",\"vsourcebillcode\":\"CD2312180009\",\"cgeneralhid\":\"1001A0100000001TGMDU\",\"bcompare\":\"N\",\"nqtorigprice\":\"4.115044\",\"bfixedasset\":\"N\",\"cfanaceorgoid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJA\"},\"csourcebillhid\":\"1001A0100000001TGMDM\",\"ngroupexchgrate\":\"1\",\"corpvid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJ9\"},\"ctaxcodeid\":{\"code\":\"CN13\",\"name\":\"一般纳税货品增值税（13%）\",\"pk\":\"1002Z01000000001CNE2\"},\"cfirstbillbid\":\"1001A0100000001TGMDN\",\"nchangestdrate\":\"1\",\"norigprice\":\"4.115044\",\"ncaltaxmny\":\"20571.11\",\"nitemdiscountrate\":\"100\",\"nassistnum\":\"4999\",\"corpoid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJA\"},\"vqtunitrate\":\"1/1\",\"norigtaxprice\":\"4.65\",\"ngroupmny\":\"20571.11\",\"nglobalexchgrate\":\"1\",\"cgeneralbid\":\"1001A0100000001TGMDV\",\"nshouldnum\":\"4999\",\"castunitid\":{\"code\":\"MTR\",\"name\":\"米\",\"pk\":\"0001Z0100000000000XL\"},\"nqtorigtaxprice\":\"4.65\",\"borrowinflag\":\"N\",\"cunitid\":{\"code\":\"MTR\",\"name\":\"米\",\"pk\":\"0001Z0100000000000XL\"},\"ntaxmny\":\"23245.35\",\"csourcebillbid\":\"1001A0100000001TGMDN\",\"ntaxprice\":\"4.65\",\"nsignnum\":\"0\",\"cvendorid\":{\"code\":\"01000916\",\"name\":\"郑州特种电缆有限公司\",\"pk\":\"1001A110000000000YX0\"},\"bonroadflag\":\"N\",\"bsourcelargess\":\"N\",\"bassetcard\":\"N\",\"corigcurrencyid\":{\"code\":\"CNY\",\"name\":\"人民币\",\"pk\":\"1002Z0100000000001K1\"},\"vfirstbillcode\":\"CD2312180009\",\"cfirstbillhid\":\"1001A0100000001TGMDM\",\"flargess\":\"N\",\"nqtorignetprice\":\"4.115044\",\"nglobalmny\":\"20571.11\",\"cvendorvid\":{\"code\":\"01000916\",\"name\":\"郑州特种电缆有限公司\",\"pk\":\"1001A110000000000YX0\"},\"nnetprice\":\"4.115044\",\"pk_group\":{\"code\":\"1\",\"name\":\"瑞丰集团\",\"pk\":\"0001A110000000000C8B\"},\"creqstoorgvid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJ9\"},\"cfirsttranstype\":\"1001A110000000002KPV\",\"nprice\":\"4.115044\",\"pk_org\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJA\"},\"nvolume\":\"0\",\"bopptaxflag\":\"N\",\"csrcmaterialvid\":{\"code\":\"010203040000035\",\"name\":\"屏蔽信号线\",\"pk\":\"1001A110000000000DTG\"},\"ngrouptaxmny\":\"23245.35\",\"ntaxrate\":\"13\",\"cbodywarehouseid\":{\"code\":\"rf02\",\"name\":\"配件库\",\"pk\":\"1001A1100000000012LG\"},\"cmaterialvid\":{\"code\":\"010203040000035\",\"name\":\"屏蔽信号线\",\"pk\":\"1001A110000000000DTG\"},\"pk_org_v\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJ9\"},\"vfirstrowno\":\"10\",\"norignetprice\":\"4.115044\",\"norigtaxmny\":\"23245.35\",\"csrcmaterialoid\":{\"code\":\"010203040000035\",\"name\":\"屏蔽信号线\",\"pk\":\"1001A110000000000DTG\"},\"nqttaxnetprice\":\"4.65\",\"nweight\":\"0\",\"vchangerate\":\"1/1\",\"nqtunitnum\":\"4999\",\"cqtunitid\":{\"code\":\"MTR\",\"name\":\"米\",\"pk\":\"0001Z0100000000000XL\"},\"crowno\":\"10\",\"nmny\":\"20571.11\",\"cmaterialoid\":{\"code\":\"010203040000035\",\"name\":\"屏蔽信号线\",\"pk\":\"1001A110000000000DTG\"},\"norigmny\":\"20571.11\",\"ncalcostmny\":\"20571.11\",\"creqstoorgoid\":{\"code\":\"1001\",\"name\":\"新乡市瑞丰新材料股份有限公司\",\"pk\":\"0001A110000000002TJA\"}}]}],\"code\":\"1000000000\",\"message\":\"采购入库单查询成功\",\"errorStack\":null}";

        JSONObject jsonObject = JSONObject.fromObject(pp);
        JSONArray jsonArray = jsonObject.optJSONArray("data");
        JSONObject poh = new JSONObject();
        poh.put("darrivedate","2024-04-01 16:08:29");
        poh.put("dmakedate","2024-04-01 16:08:29");
        String hid = "";
        String vbillcode = "";

        for (Object o : jsonArray) {
            JSONObject jsonObject1 = JSONObject.fromObject(o);
            JSONObject jsonObject2 = jsonObject1.optJSONObject("ic.PurchaseInHeadVO");

            Set set = jsonObject2.keySet();
            for (Object o1 : set) {
                String s1 = String.valueOf(o1);
                JSONObject jsonObject4 = jsonObject2.optJSONObject(s1);
                if(null != jsonObject4){
//                    JSONObject jsonObject3 = JSONObject.fromObject(o1);
                    String pk = jsonObject4.optString("pk");
                    poh.put(s1,pk);
                }else{
                    String s2 = jsonObject2.optString(s1);
                    if(StringUtils.isNotEmpty(s2)){
                        if("cgeneralhid".equals(s1)){
                            hid = s2;
                        }else if("rf282403060127".equals(s1)){
                            vbillcode = s2;
                        }else if("ctrantypeid".equals(s1)){
                            poh.put(s1,"0001A110000000002BLW");
                        }else if("vtrantypecode".equals(s1)){
                            poh.put(s1,"25-01");
                        }else{
                            poh.put(s1,s2);
                        }

                    }
                }
            }
        }
        JSONObject pob = new JSONObject();
        poh.put("darrivedate","2024-04-01 16:08:29");
        poh.put("dmakedate","2024-04-01 16:08:29");
        poh.put("dbilldate","2024-04-01 16:08:29");
        poh.put("cgeneralhid",hid);
        poh.put("csourcetypecode","45");
        for (Object o : jsonArray) {
            JSONObject jsonObject1 = JSONObject.fromObject(o);
            JSONArray jsonArray1 = jsonObject1.optJSONArray("ic.PurchaseInBodyVO");
            for (Object o11 : jsonArray1) {
                JSONObject jsonObject2 = JSONObject.fromObject(o11);

                Set set = jsonObject2.keySet();
                for (Object o1 : set) {
                    String s1 = String.valueOf(o1);
                    JSONObject jsonObject4 = jsonObject2.optJSONObject(s1);
                    if(null != jsonObject4){
//                    JSONObject jsonObject3 = JSONObject.fromObject(o1);
                        String pk = jsonObject4.optString("pk");
                        pob.put(s1,pk);
                    }else{
                        String s2 = jsonObject2.optString(s1);
                        if(StringUtils.isNotEmpty(s2)){
                            if("cgeneralbid".equals(s1)){
                                pob.put("csourcebid",s2);
                            }else if("ctrantypeid".equals(s1)){
                                poh.put(s1,"0001A110000000002BLW");
                            }else if("vtrantypecode".equals(s1)){
                                poh.put(s1,"25-01");
                            }else if("vsourcecode".equals(s1)){
                                poh.put(s1,vbillcode);
                            }
                            else{
                                pob.put(s1,s2);
                            }

                        }
                    }
                }
            }

        }

        JSONArray jpb = new JSONArray();
        jpb.add(pob);
        JSONObject tt = new JSONObject();
        tt.put("po_invoice",poh);
        tt.put("po_invoice_b",jpb);
        JSONArray pja = new JSONArray();
        pja.add(tt);

        JSONObject tt1 = new JSONObject();
        tt1.put("data",pja);
        String requestParam = tt1.toString();

        System.out.println("参数"+requestParam);
        // 携带token访问接口，获取结果
        String result = util.getAPIRetrun(token, requestParam);

        System.out.println("-----");
        System.out.println("返回结果"+result);
    }


//    public static void main(String[] args) {
//
//        String str = "{\"success\":true,\"data\":\"{\\\"pageid\\\":\\\"400401600_card\\\",\\\"head\\\":{\\\"card_head\\\":{\\\"areaType\\\":\\\"form\\\",\\\"rows\\\":[{\\\"values\\\":{\\\"pk_org_v\\\":{\\\"value\\\":\\\"0001A110000000002TJ9\\\"},\\\"ctrantypeid\\\":{\\\"value\\\":\\\"0001A110000000002BLW\\\"},\\\"finvoiceclass\\\":{\\\"value\\\":\\\"0\\\"},\\\"dbilldate\\\":{\\\"value\\\":\\\"2023-12-28 19:09:08\\\"},\\\"darrivedate\\\":{\\\"value\\\":\\\"2023-12-28 19:09:08\\\"},\\\"pk_supplier\\\":{\\\"value\\\":\\\"1001A110000000000ZCF\\\"},\\\"pk_supplier_v\\\":{\\\"value\\\":\\\"1001A110000000000ZCF\\\"},\\\"corigcurrencyid\\\":{\\\"value\\\":\\\"1002Z0100000000001K1\\\"},\\\"pk_bizpsn\\\":{\\\"value\\\":\\\"0001A11000000001G73Z\\\"},\\\"pk_dept_v\\\":{\\\"value\\\":\\\"0001A1100000000036AU\\\"},\\\"pk_stockorg_v\\\":{\\\"value\\\":\\\"0001A110000000002TJ9\\\"},\\\"pk_paytosupplier\\\":{\\\"value\\\":\\\"1001A110000000000ZCF\\\"},\\\"pk_balatype\\\":{\\\"value\\\":\\\"\\\"},\\\"binitial\\\":{\\\"value\\\":\\\"false\\\"},\\\"ntotalastnum\\\":{},\\\"ntotalorigmny\\\":{},\\\"vmemo\\\":{\\\"value\\\":\\\"RFXC-CG-B-202210-044  中石化柴油\\\"},\\\"pk_org\\\":{\\\"value\\\":\\\"0001A110000000002TJA\\\"},\\\"vbillcode\\\":{\\\"value\\\":\\\"rf45959881\\\"},\\\"bvirtual\\\":{},\\\"bfee\\\":{},\\\"pk_freecust\\\":{},\\\"supplierphone\\\":{},\\\"pk_dept\\\":{\\\"value\\\":\\\"1001A110000000002RCB\\\"},\\\"pk_stockorg\\\":{\\\"value\\\":\\\"0001A110000000002TJA\\\"},\\\"ts\\\":{},\\\"dmakedate\\\":{},\\\"creator\\\":{\\\"value\\\":\\\"1001A1100000000ATXP9\\\"},\\\"approver\\\":{},\\\"vtrantypecode\\\":{\\\"value\\\":\\\"25-01\\\"},\\\"taudittime\\\":{},\\\"creationtime\\\":{\\\"value\\\":\\\"2023-12-28 19:09:08\\\"},\\\"pk_frozenuser\\\":{},\\\"modifier\\\":{},\\\"tfrozentime\\\":{},\\\"modifiedtime\\\":{},\\\"pk_bankaccbas\\\":{},\\\"vbankaccount\\\":{},\\\"ccurrencyid\\\":{\\\"value\\\":\\\"1002Z0100000000001K1\\\"},\\\"nexchangerate\\\":{\\\"value\\\":\\\"1\\\"},\\\"vfrozenreason\\\":{},\\\"bfrozen\\\":{},\\\"pk_busitype\\\":{\\\"value\\\":\\\"1001A110000000002LDC\\\"},\\\"pk_purchaseorg\\\":{\\\"value\\\":\\\"0001A110000000002TJA\\\"},\\\"pk_purchaseorg_v\\\":{\\\"value\\\":\\\"0001A110000000002TJ9\\\"},\\\"pk_payterm\\\":{},\\\"ftaxtypeflagh\\\":{\\\"value\\\":\\\"1\\\"},\\\"ntaxrateh\\\":{\\\"value\\\":\\\"13\\\"},\\\"vparentcode\\\":{},\\\"pk_parentinvoice\\\":{},\\\"ngroupexchgrate\\\":{\\\"value\\\":\\\"1\\\"},\\\"nglobalexchgrate\\\":{\\\"value\\\":\\\"1\\\"},\\\"vdef1\\\":{\\\"value\\\":\\\"\\\"},\\\"vdef2\\\":{},\\\"vdef3\\\":{},\\\"vdef4\\\":{},\\\"vdef5\\\":{},\\\"vdef6\\\":{\\\"value\\\":\\\"\\\"},\\\"vdef7\\\":{},\\\"vdef8\\\":{},\\\"vdef9\\\":{},\\\"vdef10\\\":{\\\"value\\\":\\\"\\\"},\\\"vdef11\\\":{},\\\"vdef12\\\":{},\\\"vdef13\\\":{},\\\"vdef14\\\":{},\\\"vdef15\\\":{},\\\"vdef16\\\":{},\\\"vdef17\\\":{},\\\"vdef18\\\":{},\\\"vdef19\\\":{},\\\"vdef20\\\":{},\\\"bapflag\\\":{},\\\"pk_invoice\\\":{},\\\"fbillstatus\\\":{\\\"value\\\":\\\"0\\\"},\\\"pk_group\\\":{\\\"value\\\":\\\"0001A110000000000C8B\\\"},\\\"iprintcount\\\":{\\\"value\\\":\\\"0\\\"},\\\"csendcountryid\\\":{\\\"value\\\":\\\"0001Z010000000079UJJ\\\"},\\\"crececountryid\\\":{\\\"value\\\":\\\"0001Z010000000079UJJ\\\"},\\\"ctaxcountryid\\\":{\\\"value\\\":\\\"0001Z010000000079UJJ\\\"},\\\"fbuysellflag\\\":{\\\"value\\\":\\\"2\\\"},\\\"btriatradeflag\\\":{\\\"value\\\":\\\"false\\\"},\\\"ctradewordid\\\":{\\\"value\\\":\\\"\\\"},\\\"bopptaxflag\\\":{\\\"value\\\":\\\"false\\\"},\\\"vvatcode\\\":{},\\\"vvendorvatcode\\\":{},\\\"finvoicetype\\\":{\\\"value\\\":\\\"0\\\"},\\\"saga_frozen\\\":{},\\\"saga_gtxid\\\":{},\\\"saga_btxid\\\":{},\\\"saga_status\\\":{},\\\"cextsrcsys\\\":{},\\\"billmaker\\\":{\\\"value\\\":\\\"1001A1100000000ATXP9\\\"},\\\"fratecategory\\\":{},\\\"vextsrcbillcode\\\":{},\\\"dratedate\\\":{},\\\"pseudocolumn\\\":{},\\\"vdef21\\\":{},\\\"vdef22\\\":{},\\\"vdef27\\\":{},\\\"vdef28\\\":{},\\\"vdef29\\\":{},\\\"vdef23\\\":{},\\\"vdef24\\\":{},\\\"vdef25\\\":{},\\\"vdef26\\\":{},\\\"vdef30\\\":{},\\\"vdef31\\\":{},\\\"vdef32\\\":{},\\\"vdef33\\\":{},\\\"vadjustreason\\\":{},\\\"vdef38\\\":{},\\\"vdef39\\\":{},\\\"vdef34\\\":{},\\\"vdef35\\\":{},\\\"vdef36\\\":{},\\\"vdef37\\\":{},\\\"vdef41\\\":{},\\\"vdef42\\\":{},\\\"vdef43\\\":{},\\\"vdef44\\\":{},\\\"vdef40\\\":{},\\\"dr\\\":{},\\\"vdef49\\\":{},\\\"vdef45\\\":{},\\\"vdef46\\\":{},\\\"vdef47\\\":{},\\\"vdef48\\\":{},\\\"vdef50\\\":{},\\\"csaleinvoiceid\\\":{},\\\"pk_paytosupplier_v\\\":{\\\"value\\\":\\\"1001A110000000000ZCF\\\"},\\\"cratetype\\\":{}},\\\"status\\\":\\\"1\\\"}],\\\"areacode\\\":\\\"card_head\\\"}},\\\"body\\\":{\\\"card_body\\\":{\\\"areaType\\\":\\\"table\\\",\\\"rows\\\":[{\\\"status\\\":\\\"2\\\",\\\"isOptimized\\\":false,\\\"values\\\":{\\\"cfirstbid\\\":{\\\"value\\\":\\\"1001A1100000000D9DHY\\\"},\\\"naccumsettorigmny\\\":{},\\\"nnosubtax\\\":{\\\"value\\\":\\\"0\\\"},\\\"nastprice\\\":{\\\"value\\\":\\\"7.814159\\\"},\\\"pk_material.name\\\":{\\\"value\\\":\\\"柴油\\\"},\\\"cextsrcbid\\\":{},\\\"vextsrcbillcode\\\":{},\\\"vordercode\\\":{\\\"value\\\":\\\"CD2210120079\\\"},\\\"norigtaxprice\\\":{\\\"value\\\":\\\"8.83\\\"},\\\"vbdef45\\\":{},\\\"ngroupmny\\\":{\\\"value\\\":\\\"15.63\\\"},\\\"vbdef46\\\":{},\\\"pk_material\\\":{\\\"value\\\":\\\"1001A110000000000K8D\\\"},\\\"vbdef43\\\":{},\\\"casscustid\\\":{},\\\"nnumwrbck\\\":{},\\\"vbdef44\\\":{},\\\"csourcetypecode\\\":{\\\"value\\\":\\\"45\\\"},\\\"vbdef49\\\":{},\\\"vbdef47\\\":{},\\\"vbdef48\\\":{},\\\"vbdef41\\\":{},\\\"vbdef42\\\":{},\\\"vbdef40\\\":{},\\\"naccumsettmny\\\":{},\\\"ftaxtypeflag\\\":{\\\"value\\\":\\\"1\\\"},\\\"vfree10\\\":{},\\\"pk_order\\\":{\\\"value\\\":\\\"1001A1100000000D9DHX\\\"},\\\"pseudocolumn\\\":{\\\"value\\\":\\\"0\\\"},\\\"vfirstcode\\\":{\\\"value\\\":\\\"CD2210120079\\\"},\\\"castunitid\\\":{\\\"value\\\":\\\"1001A1100000000005GQ\\\"},\\\"pk_apfinanceorg_v\\\":{\\\"value\\\":\\\"0001A110000000002TJ9\\\"},\\\"cunitid\\\":{\\\"value\\\":\\\"1001A1100000000005GQ\\\"},\\\"cfirsttypecode\\\":{\\\"value\\\":\\\"21\\\"},\\\"ntaxmny\\\":{\\\"value\\\":\\\"17.66\\\"},\\\"pk_order_b\\\":{\\\"value\\\":\\\"1001A1100000000D9DHY\\\"},\\\"vordertrantype\\\":{\\\"value\\\":\\\"1001A110000000002KPV\\\"},\\\"vmemob\\\":{\\\"value\\\":\\\"柴油机试验用油，中石化0#，按需到货\\\"},\\\"ntaxprice\\\":{\\\"value\\\":\\\"8.830000\\\"},\\\"vbdef50\\\":{},\\\"cextsrcbilltype\\\":{},\\\"vsourcerowno\\\":{\\\"value\\\":\\\"10\\\"},\\\"firstts\\\":{},\\\"nastnum\\\":{\\\"value\\\":\\\"2.00000\\\"},\\\"ntax\\\":{\\\"value\\\":\\\"2.03\\\"},\\\"vsourcecode\\\":{\\\"value\\\":\\\"RFPJ2304080024\\\"},\\\"dbilldate\\\":{},\\\"cextsrcid\\\":{},\\\"csourceid\\\":{\\\"value\\\":\\\"1001A9100000001FKKLK\\\"},\\\"nnosubtaxrate\\\":{\\\"value\\\":\\\"0\\\"},\\\"cffileid\\\":{},\\\"ccontractrowid\\\":{},\\\"nglobalmny\\\":{\\\"value\\\":\\\"15.63\\\"},\\\"nnum\\\":{\\\"value\\\":\\\"2.00000\\\"},\\\"pk_invoice_b\\\":{},\\\"pk_material.materialspec\\\":{},\\\"vbdef9\\\":{},\\\"cfirstid\\\":{\\\"value\\\":\\\"1001A1100000000D9DHX\\\"},\\\"vctcode\\\":{},\\\"nglobaltaxmny\\\":{\\\"value\\\":\\\"17.66\\\"},\\\"ts\\\":{},\\\"pk_group\\\":{\\\"value\\\":\\\"0001A110000000000C8B\\\"},\\\"casscustvid\\\":{},\\\"frowtype\\\":{\\\"value\\\":\\\"0\\\"},\\\"pk_apliabcenter\\\":{},\\\"cadjustedrowid\\\":{},\\\"firstbts\\\":{},\\\"pk_usedept\\\":{},\\\"pk_stordoc\\\":{\\\"value\\\":\\\"1001A1100000000012LG\\\"},\\\"dr\\\":{},\\\"nsourcenum\\\":{\\\"value\\\":\\\"4500\\\"},\\\"nprice\\\":{\\\"value\\\":\\\"7.814159\\\"},\\\"pk_org\\\":{\\\"value\\\":\\\"0001A110000000002TJA\\\"},\\\"vbdef8\\\":{},\\\"pk_supplier\\\":{},\\\"vbdef7\\\":{},\\\"vbdef6\\\":{},\\\"naccumsettnum\\\":{},\\\"vbdef5\\\":{},\\\"vbdef4\\\":{},\\\"vbdef3\\\":{},\\\"vbdef2\\\":{},\\\"vbdef1\\\":{},\\\"cprojecttaskid\\\":{},\\\"nreasonwastenum\\\":{},\\\"ngrouptaxmny\\\":{\\\"value\\\":\\\"17.66\\\"},\\\"vfree1\\\":{},\\\"sourcebts\\\":{\\\"value\\\":\\\"2023-12-28 19:08:32\\\"},\\\"vfirsttrantype\\\":{\\\"value\\\":\\\"1001A110000000002KPV\\\"},\\\"pk_apfinanceorg\\\":{\\\"value\\\":\\\"0001A110000000002TJA\\\"},\\\"pk_order_payplan\\\":{},\\\"vsourcetrantype\\\":{\\\"value\\\":\\\"1001A110000000002L3S\\\"},\\\"dsourcedate\\\":{\\\"value\\\":\\\"2023-04-08 14:49:36\\\"},\\\"vbdef12\\\":{},\\\"pk_supplier_v\\\":{},\\\"vbdef13\\\":{},\\\"vbdef10\\\":{},\\\"vbdef11\\\":{\\\"value\\\":\\\"2.00000\\\"},\\\"nasttaxprice\\\":{\\\"value\\\":\\\"8.830000\\\"},\\\"pk_srcmaterial\\\":{\\\"value\\\":\\\"1001A110000000000K8D\\\"},\\\"vbdef16\\\":{},\\\"vbdef17\\\":{},\\\"vbdef14\\\":{},\\\"ntaxrate\\\":{\\\"value\\\":\\\"13\\\"},\\\"vbdef15\\\":{},\\\"vfree8\\\":{},\\\"vfree9\\\":{},\\\"vfree6\\\":{},\\\"pk_org_v\\\":{\\\"value\\\":\\\"0001A110000000002TJ9\\\"},\\\"vfree7\\\":{},\\\"cproductorid\\\":{},\\\"vfree4\\\":{},\\\"nadjustorgprice\\\":{},\\\"vfree5\\\":{},\\\"vfree2\\\":{},\\\"vfirstrowno\\\":{\\\"value\\\":\\\"10\\\"},\\\"vfree3\\\":{},\\\"pk_order_payplan_b_ts\\\":{},\\\"pk_usedept_v\\\":{},\\\"cqualitylevelid\\\":{},\\\"norigtaxmny\\\":{\\\"value\\\":\\\"17.66\\\"},\\\"pk_invoice\\\":{},\\\"pk_stockps_b\\\":{},\\\"vbdef18\\\":{},\\\"vbdef19\\\":{},\\\"sourcets\\\":{\\\"value\\\":\\\"2023-04-08 14:50:14\\\"},\\\"vbdef23\\\":{},\\\"ctaxcodeid\\\":{\\\"value\\\":\\\"1002Z01000000001CNE2\\\"},\\\"vbdef24\\\":{},\\\"nastorigtaxprice\\\":{\\\"value\\\":\\\"8.830000\\\"},\\\"vbdef21\\\":{},\\\"vbdef22\\\":{},\\\"csourcebid\\\":{\\\"value\\\":\\\"1001A9100000001FKKLL\\\"},\\\"vbdef27\\\":{},\\\"pk_apliabcenter_v\\\":{},\\\"vbdef28\\\":{},\\\"cadjustedinvid\\\":{},\\\"vbdef25\\\":{},\\\"vbdef26\\\":{},\\\"pk_costsubj\\\":{},\\\"pk_batchcode\\\":{},\\\"nplanprice\\\":{},\\\"vbdef20\\\":{},\\\"naccumnosubmny\\\":{},\\\"pk_order_payplan_ts\\\":{},\\\"cprojectid\\\":{},\\\"vchangerate\\\":{\\\"value\\\":\\\"1/1\\\"},\\\"pk_material.materialtype\\\":{},\\\"vbdef29\\\":{},\\\"norigprice\\\":{\\\"value\\\":\\\"7.814159\\\"},\\\"vbdef34\\\":{},\\\"vbdef35\\\":{},\\\"crowno\\\":{\\\"value\\\":\\\"10\\\"},\\\"vbdef32\\\":{},\\\"vbdef33\\\":{},\\\"ncaltaxmny\\\":{\\\"value\\\":\\\"15.63\\\"},\\\"pk_order_payplan_b\\\":{},\\\"vbdef38\\\":{},\\\"vbdef39\\\":{},\\\"ccontractid\\\":{},\\\"vbdef36\\\":{},\\\"nastorigprice\\\":{\\\"value\\\":\\\"7.814159\\\"},\\\"vbdef37\\\":{},\\\"vbatchcode\\\":{},\\\"nmny\\\":{\\\"value\\\":\\\"15.63\\\"},\\\"norigmny\\\":{\\\"value\\\":\\\"15.63\\\"},\\\"vbdef30\\\":{},\\\"ncalcostmny\\\":{\\\"value\\\":\\\"15.63\\\"},\\\"vadjedbillcode\\\":{},\\\"vbdef31\\\":{},\\\"opr\\\":{},\\\"numberindex\\\":{\\\"value\\\":\\\"1\\\"}},\\\"key\\\":\\\"500520.0ba103219b576683\\\",\\\"rowId\\\":\\\"500520.0ba103219b576683\\\",\\\"rowid\\\":\\\"500520.0ba103219b576683\\\",\\\"pid\\\":\\\"root\\\",\\\"isLeaf\\\":true,\\\"depth\\\":0,\\\"path\\\":[\\\"500520.0ba103219b576683\\\"],\\\"height\\\":0,\\\"dataIndex\\\":0,\\\"leafIndex\\\":0,\\\"range\\\":[0,1],\\\"viewIndex\\\":0,\\\"selected\\\":false}],\\\"areacode\\\":\\\"card_body\\\"}},\\\"templetid\\\":\\\"1001A110000000002VWX\\\",\\\"skipCodes\\\":[]}\",\"code\":\"1000000000\",\"message\":null,\"errorStack\":null}\n";
//        JSONObject jsonObject = JSONObject.fromObject(str);
//        String data = jsonObject.optString("data");
//        JSONObject jsonObject1 = JSONObject.fromObject(data);
//
//        //        String s = str.replaceAll("\\d", "");3306 8080 6379 1521 1433
//        System.out.println(str);
//        System.out.println(data);
//        System.out.println(jsonObject1);
//
//    }
}